home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2492 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Need help with SPAWN use!
  5. Date: Sun, 21 Jan 96 22:07:02 GMT
  6. Organization: none
  7. Message-ID: <822262022snz@genesis.demon.co.uk>
  8. References: <4drda0$okm@is05.micron.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4drda0$okm@is05.micron.net> ssharpe@micron.net "ssharpe" writes:
  15.  
  16. >I'm trying to execute PKZIP from within my C program and errno
  17. >consistently reports -1.  I'm using Turbo C/C++ V3.0.  I tried the
  18. >system command (system("pkzip");) without success and I tried spawn
  19. >(spawnlp(P_WAIT,"pkzip",NULL);).  Pkzip is in my DOS path.
  20.  
  21. As far as the C language goes the value of errno after a call to system()
  22. is not defined. Maybe it is being set to -1 by the system() on your
  23. implementation or maybe it is just a hold-over from an earlier library
  24. call. Either way it makes no sense to test errno unless its value is
  25. defined by yuor implementation (and doing so is not portable). Check the
  26. documentation that comes with your particular compiler. spawnlp() is not
  27. defined by the C language. You'd probably be better off discussing this in
  28. comp.os.msdos.programmer.
  29.  
  30. -- 
  31. -----------------------------------------
  32. Lawrence Kirby | fred@genesis.demon.co.uk
  33. Wilts, England | 70734.126@compuserve.com
  34. -----------------------------------------
  35.